/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-02-17
 * Time: 19:16
 */
public class test1 {
    /**
     * NewCoder MT1  最大差值
     */

    public int getDis (int[] nums, int n) {
        int min = Integer.MAX_VALUE;
        int ret = 0;
        for(int i=0;i<n;i++){
            min = Math.min(min,nums[i]);
            ret = Math.max(ret,nums[i]-min);
        }
        return ret;
    }
}
